<template>
  <div class="login-page">
    <!-- 顶部 LOGO -->
    <div class="top-bar">
      <img class="logo" :src="logoUrl" alt="logo" />
      <span class="divider">|</span>
      <span class="login-link">登录</span>
    </div>

    <!-- 登录主内容 -->
    <div class="login-wrapper">
      <div class="login-container">
        <div class="login-box">
          <!-- 左侧图片 -->
          <div class="login-image">
            <img
              src="https://p0.meituan.net/dppclogin/0e02c95f7baaf00a3ddbd3b4068e3756207203.png"
              alt="背景图"
            />
          </div>
          <!-- 登录表单组件 -->
          <HuangLoginForm />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
const logoUrl =
  "https://p0.meituan.net/dppclogin/eb8b5352f99809d07449f3289e78beb417299.png";
import HuangLoginForm from '../components/HuangLoginForm.vue'
</script>

<style scoped>
.login-page {
  background-color: #fff;
  min-height: 100vh;
  overflow: hidden;
}

.top-bar {
  position: fixed;
  top: 30px;
  left: 70px;
  display: flex;
  align-items: center;
  font-size: 18px;
  z-index: 1000;
}

.top-bar .logo {
  height: 54px;
  margin-right: 12px;
}

.top-bar .divider {
  margin: 0 12px;
  color: #ccc;
  font-weight: normal;
}

.top-bar .login-link {
  color: #605c5c;
  cursor: pointer;
  font-weight: bold;
}

.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding-top: 80px;
  box-sizing: border-box;
}

.login-container {
  width: 90vw;
  max-width: 960px;
  background-color: #f5f5f5;
  padding: 4vh 3vw;
  border-radius: 10px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-box {
  display: flex;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
  min-height: 360px;
}

.login-image {
  flex: 1;
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.login-image img {
  max-width: 100%;
  height: auto;
}

.login-card {
  width: 320px;
  max-width: 45%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid #eee;
}

.login-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 16px;
  color: #666;
}

.login-tabs span {
  cursor: pointer;
  padding-bottom: 4px;
}

.login-tabs .active {
  color: #f60;
  border-bottom: 2px solid #f60;
  font-weight: bold;
}

/* 新增二维码图标和悬浮提示样式 */
.icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-left: 8px;
}

.dialog-wrapper {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(51, 51, 51, 0.9);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  display: none;
  z-index: 10;
}

.icon-wrapper:hover .dialog-wrapper {
  display: block;
}

.qr-icon {
  width: 60px;
  height: 60px;
}

/* 手机号输入区域 */
.phone-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.country-code {
  display: flex;
  align-items: center;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 0 8px;
  height: 40px;
  background-color: #fff;
  font-size: 14px;
  color: #333;
}

.country-code span {
  margin-right: 6px;
}

.country-code select {
  border: none;
  outline: none;
  font-size: 14px;
  background-color: transparent;
  appearance: none;
  cursor: pointer;
}

.phone-number {
  flex: 1;
  height: 40px;
  padding-left: 10px;
  font-size: 14px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  outline: none;
  box-sizing: border-box;
}

.password-input {
  height: 40px;
  padding-left: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.forgot-password {
  text-align: right;
  margin-bottom: 12px;
  font-size: 12px;
}

.forgot-password a {
  color: #409eff;
  text-decoration: none;
}

.login-button {
  width: 100%;
  background-color: #f60;
  color: white;
  padding: 10px;
  font-size: 16px;
  border: none;
  cursor: pointer;
  margin-bottom: 12px;
  border-radius: 4px;
}

.agreement {
  font-size: 12px;
  color: #999;
}

.agreement a {
  color: #409eff;
  text-decoration: none;
}
</style>
